More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
post
page
Python IDE Dashboard

BBC Micro – Creating a Text-Based Adventure Story Game

This tutorial is the fourth of a set of lessons/tutorials that focus on:

BBC Micro Online Emulator

To complete these lessons, you do not need access to a physical BBC micro computer. You can use the following online emulator and type commands in your browser, without the need to install anything on your computer.

You may also find the following BBC Basic emulator quite handy for testing your own BBC Basic programs.

️ Upside-Down World — BBC BASIC Text Adventure Tutorial

You are about to create a game called “Upside-Down World”, a text-based adventure game inspired by the series Stranger Things. This game will let the player make choices that affect the story.

Story Setup

Here is the background context for this game:

  • You play as Eleven.
  • You discover a mysterious Gate to the Upside-Down world.
  • Your mission: find Will Byers, a friend of yours who is trapped in the Upside-Down.
  • At each point, the player must choose what to do next.
Step 1 — Planning the Game Structure
Step 1 — Planning the Game Structure

Our code will mainly be based on using the following BBC Basic commands:

  • PRINT → to show story text
  • INPUT → to get player choices
  • IF … THEN → to react to choices
  • GOTO → to move between story sections (using line numbers)

Each part of the story will have its own section in our program, for example:

  • From line 10 to 990: The title screen and introduction to the story line
  • From line 1000 The discovery of a gate to the Upside-Down
  • From line 1500 What happens if the player decides to run away from the gate
  • From line 2000 What happens if the player decides to go through the gate
  • etc.
Step 2 — Adding a Title Screen
Step 2 — Title Screen
10 MODE 7
20 PRINT "=============================="
30 PRINT "     UPSIDE-DOWN WORLD"
40 PRINT "=============================="
50 PRINT
60 PRINT "A Stranger Things Inspired Adventure"
70 PRINT
80 PRINT "Press ENTER to begin"
90 INPUT A$
100 GOTO 1000

This creates a simple intro screen.
You can test your game so far by using the RUN command:

RUN
Step 3 — Starting the Story
Step 3 — Starting the Story
1000 CLS
1010 PRINT "You are Eleven."
1020 PRINT "It is late at night in Hawkins."
1030 PRINT "Suddenly, you feel something strange..."
1040 PRINT
1050 PRINT "In the woods, you see a glowing GATE."
1060 PRINT
1070 PRINT "Do you:"
1080 PRINT "1 - Go through the Gate"
1090 PRINT "2 - Run back to town"
1100 PRINT
1110 INPUT "Enter 1 or 2: " choice

1120 IF choice = 1 THEN GOTO 2000
1130 IF choice = 2 THEN GOTO 1500
1140 GOTO 1110

The GOTO instruction on line 1140 means that if the player types something else (not option 1 or 2), the game asks the same question again.


Step 4 — Running Back to Town Path
Step 4 — Running Back to Town Path
1500 CLS
1510 PRINT "You run back towards Hawkins."
1520 PRINT "You tell Mike and Dustin about the Gate."
1530 PRINT
1540 PRINT "They decide you must go back and rescue Will!"
1550 PRINT
1560 PRINT "You return to the woods together..."
1570 PRINT
1580 PRINT "Press ENTER to continue"
1590 INPUT A$
1600 GOTO 2000

This brings the story back to the main mission.

Step 5 — Entering the Upside-Down
Step 5 — Entering the Upside-Down
2000 CLS
2010 PRINT "You step through the Gate..."
2020 PRINT
2030 PRINT "The world is dark and cold."
2040 PRINT "Strange sounds echo around you."
2050 PRINT
2060 PRINT "You must find Will before it's too late."
2070 PRINT
2080 PRINT "You see:"
2090 PRINT "1 - An old abandoned school"
2100 PRINT "2 - A dark tunnel leading underground"
2110 PRINT
2120 INPUT "Where do you go? (1 or 2): " choice

2130 IF choice = 1 THEN GOTO 3000
2140 IF choice = 2 THEN GOTO 4000
2150 GOTO 2120

Now the player can choose different paths.

Step 6 — One Example Location
Step 6 — One Example Location
3000 CLS
3010 PRINT "You enter the ruined school."
3020 PRINT "Desks are overturned."
3030 PRINT
3040 PRINT "You hear a noise upstairs..."
3050 PRINT
3060 PRINT "Do you:"
3070 PRINT "1 - Go upstairs"
3080 PRINT "2 - Hide and listen"
3090 PRINT
3100 INPUT "Choose 1 or 2: " choice

3110 IF choice = 1 THEN GOTO 5000
3120 IF choice = 2 THEN GOTO 6000
3130 GOTO 3100

From here, you will have to be creative with your story line. You can add monsters, clues, or even rescue scenes.

Step 7 — Suggested Storyline Ideas
Step 7 — Suggested Storyline Ideas

Here are a few ideas of some of the new scenes you can add to your story lines.

  • You collect some items in a room of the school (e.g. torch, radio, weapon)
  • You are face to face with a Demogordon (monster) in the school library, will you fight it or run away?
  • You find Will hiding in the school sports hall


Here are some possible endings for your game:

  • You rescue will successfully, and run back to the gate to escape from the Upside-Down
  • You rescue will successfully, and run back to the gate to escape from the Upside-Down but a Demogordon follows you through the gate…
  • The gate you used to access the Upside-Down is now closed so you too end up getting trapped in the Upside-Down
  • You cannot find Will anywhere and decided to escape through the gate. This would mean that you have failed the mission
Step 8 — Extra Challenges Ideas
Step 8 — Extra Challenges Ideas

There are so many ways you could make you game even more complex and engaging to play

Here are some suggestions of what you could add to the game:

⭐ Beginner Level:

  • Add another location in the Upside-Dow
  • Add more dialogue for each scene

⭐⭐ Intermediate Level:

  • Add a health score
  • Lose health when meeting a monster

⭐⭐⭐ Expert Level:

  • Add an inventory system
  • Give more options on different scenes based on the items the player has collected.
    For instance they can only go through the underground tunnel if they have previously collected a torch.

Example health system idea:
Towards the start of you code, initialise the players health to 100.

LET health = 100

When the players fight a Demagordon they lose some of their health score.

health = health - 20
PRINT "Health Score: "; health
IF health <= 0 THEN GOTO 9000
Step 6 — One Example Location
Game Over Example
9000 CLS
9010 PRINT "You collapse from your injuries..."
9020 PRINT
9030 PRINT "The Upside-Down has claimed another victim."
9040 PRINT
9050 PRINT "GAME OVER"

BBC Micro – My First Program

This tutorial is the third of a set of lessons/tutorials that focus on:

BBC Micro Online Emulator

To complete these lessons, you do not need access to a physical BBC micro computer. You can use the following online emulator and type commands in your browser, without the need to install anything on your computer.

You may also find the following BBC Basic emulator quite handy for testing your own BBC Basic programs.

Writing, Testing and Editing Your First Program

The aim of this tutorial is for you to become confident at writing, editing and testing computer programs written in BBC Basic on a BBC Micro computer.

To do so, we will guide step by step to create a classic Magic 8 Ball program!

By the end of this tutorial you will know how to:

  • Enter a program in BBC BASIC
  • Run and test your program
  • Add, edit and delete lines of your program
  • Get more familiar with some essential BBC Basic instructions
  • Understand how each part of the Magic 8 Ball program works

To create our Magic 8 Ball program using BBC Basic, we will use a step by step approach using the following 15 steps! Make sure to complete all these steps in order and to keep track of your progress!

Step 1 - Starting a Program on the BBC Micro
Starting a Program on the BBC Micro
When you switch on a BBC Micro, you will see:

BBC Computer 32K
>

The > is the command prompt. This means the computer is ready for you to type commands or program lines.

To start writing a program, just type a line number followed by a command, for example:

10 PRINT "HELLO"

Press RETURN after each line.

Running Your Program

To run the whole program, type:

RUN

and press RETURN.

If you change the program, just type RUN again to test it.
To exit a program that is running, press the BREAK on the keyboard.

Step 2 - Adding Lines to a Program
Adding Lines to a Program
To add a new line to a program, just type the line number and the BBC Basic code for this new line.

The line will automatically be added to your program in the right position depending on the line number provided.

For instance, add the following lines to your program to create a banner to your Magic 8 Ball program.

20 PRINT "========================"
30 PRINT "| MAGIC 8 BALL |" 
40 PRINT "========================"
Step 3 - Viewing Your Code
Viewing Your Code
To view your whole BBC Basic code type:

LIST

For a long a program you can filter the lines of code you would like to review:

LIST 20,50

This will only show you program from line 20 to line 50.

Step 4 - Editing/Replacing an Existing Line of a Program
Editing/Replacing an Existing Line of a Program
To edit/replace an existing line of code just retype it using the leine number of the line you wish to replace and the new code you would like the line to be replaced with.

For instance in the code above we will replace line 10 which outputs the word “HELLO” with the following code used to clear the screen.

Using the command prompt, type:

10 CLS
Step 5 - Removing a Line of a Program
Removing a Line of a Program
If you do not require a line within your code just type the line number of the line you would like to remove and press RETURN.

For instance to remove line 10, type:

10

To check that the line is gone, check your code:

LIST

Note that we actually need line 10 so you may want to insert it again.

10 CLS
Step 6 - Adding Annotations to Your Code
Adding Annotations to Your Code
As it is good practice to annotate a program we will add a new line of code at the very top of our code, before line 10. We will use a REM command which is used to annotate the code.

5 REM Magic 8 Ball Program - v1.0

Notice how we inserted our new line of code at line 5. This is the reason why, when numbering lines, we tend to always count in 10: This allows us to then insert new lines between two existing lines.

Check your code listing again to see the end result.

With his approach, line numbering can quickly become untidy. From time to time you can ask the BBC Micro to renumber all the lines of your program, starting at line 10 and counting in 10, using the following instruction.

RENUMBER 10,10

Try it with your own code and notice how line 5 is now renumbered as line 10.


So at this stage your whole code should look like this:

10 REM  Magic 8 Ball Program v1.0 
20 CLS
30 PRINT "========================"
40 PRINT "|     MAGIC  8  BALL   |"
50 PRINT "========================"
Step 7 - Saving and Loading a Program
Saving a Program
This program as not been saved yet, so you are at risk of loosing all your code if the computer crashes. to save your work, use the following command:

SAVE MAGIC8

⚠️ Remember, on a BBC Micro filenames can only contain up to 7 characters.

Now that your program is saved, you will be able to reload it at any time using:

LOAD MAGIC8

There is no auto-save features on the BBC Micro so make sure to save your work every so often as you add more lines to your code.

Step 8 - Displaying Instructions on the Screen
Ok great, so now let’s add more lines of code to our program. By doing so you will learn some very useful BBC Basic instructions.

Displaying Instructions on the Screen
Let’s add the following code:

60 PRINT
70 PRINT ">> Ask a YES/NO question, then press RETURN"
80 PRINT

The PRINT instruction is used to display some text on the screen.
When used on its own, the PRINT instruction leaves an empty line for spacing.

Step 9 - Adding the Main Program Loop
Adding a Main Program Loop
We will use a loop so that the end-user can use the Magic 8 Ball to ask as many questions as they wish.

90 REPEAT

This starts a REPEAT-UNTIL loop. All the code between this line and a line starting with UNTILL will be part of our loop.

Step 10 - Asking the User to Input a Question
Asking the Question

100   PRINT "========================"
110   INPUT "Your question: " Q$
120   IF Q$="" THEN PRINT "You must ask a question!":GOTO 110
  • INPUT lets the user type text.
  • Q$ is a string variable (the $ means text).
  • If the user presses RETURN without typing anything:
    • It prints a warning
    • GOTO 110 sends them back to line 110 to ask the user to enter a question again
Step 11 - Choosing a Random Answer
Choosing a Random Answer

130   R = RND(20)

RND(20) gives a random number from 1 to 20.
This number is stored in variable called R (for Response)

This decides which answer the Magic 8 Ball gives.

Step 12 - Displaying the Result
Displaying the Result

140   PRINT
150   PRINT "The Magic 8 Ball says:"
160   PRINT

Just formatting — makes the output look nicer.


The 20 Possible Answers

170   IF R=1  THEN PRINT "It is certain."
180   IF R=2  THEN PRINT "It is decidedly so."
190   IF R=3  THEN PRINT "Without a doubt."
200   IF R=4  THEN PRINT "Yes - definitely."
210   IF R=5  THEN PRINT "You may rely on it."
220   IF R=6  THEN PRINT "As I see it, yes."
230   IF R=7  THEN PRINT "Most likely."
360   IF R=8  THEN PRINT "Outlook good."
240   IF R=9  THEN PRINT "Yes."
250   IF R=10 THEN PRINT "Signs point to yes."
260   IF R=11 THEN PRINT "Reply hazy, try again."
270   IF R=12 THEN PRINT "Ask again later."
280   IF R=13 THEN PRINT "Better not tell you now."
290   IF R=14 THEN PRINT "Cannot predict now."
300   IF R=15 THEN PRINT "Concentrate and ask again."
310   IF R=16 THEN PRINT "Don't count on it."
320   IF R=17 THEN PRINT "My reply is no."
330   IF R=18 THEN PRINT "My sources say no."
340   IF R=19 THEN PRINT "Outlook not so good."
350   IF R=20 THEN PRINT "Very doubtful."

Each IF checks the random number. Only one of these will match. That matching answer is then displayed on screen.

Step 13 - Asking to Play Again?
Asking to Play Again
We will end our program by asking if the user would like to ask another question. This will be useful to use the user answer as a stopping condition for our main program loop.

360   PRINT
370   INPUT "Do you want to ask another question (Y/N)? " A$
380 UNTIL A$="N" OR A$="n"

In the above code:

  • A$ stores the user’s answer
  • The loop continues until the end-user types N or n
    So typing:

      Y → play again, the user will be able to enter another question
      N → stop
Step 14 - Ending the Program
Ending the Program

390 CLS
400 PRINT "Goodbye... the Magic 8 Ball rests!"

The above code will:

  • Clear the screen (CLS)
  • Show a goodbye message (PRINT)
Step 15 - Saving Your Work
Saving your work
You can now test your program using the RUN command and do not forget to save your work using the SAVE command!

SAVE MAGIC8
Full BBC Basic Code
Full BBC Basic Code for the Magic 8 Ball Program:

10 REM  Magic 8 Ball Program v1.0 
20 CLS
30 PRINT "========================"
40 PRINT "|     MAGIC  8  BALL   |"
50 PRINT "========================"
60 PRINT
70 PRINT ">> Ask a YES/NO question, then press RETURN"
80 PRINT
90 REPEAT
100   PRINT "========================"
110   INPUT "Your question: " Q$
120   IF Q$="" THEN PRINT "You must ask a question!":GOTO 110
130   R = RND(20)
140   PRINT
150   PRINT "The Magic 8 Ball says:"
160   PRINT
170   IF R=1  THEN PRINT "It is certain."
180   IF R=2  THEN PRINT "It is decidedly so."
190   IF R=3  THEN PRINT "Without a doubt."
200   IF R=4  THEN PRINT "Yes - definitely."
210   IF R=5  THEN PRINT "You may rely on it."
220   IF R=6  THEN PRINT "As I see it, yes."
230   IF R=7  THEN PRINT "Most likely."
360   IF R=8  THEN PRINT "Outlook good."
240   IF R=9  THEN PRINT "Yes."
250   IF R=10 THEN PRINT "Signs point to yes."
260   IF R=11 THEN PRINT "Reply hazy, try again."
270   IF R=12 THEN PRINT "Ask again later."
280   IF R=13 THEN PRINT "Better not tell you now."
290   IF R=14 THEN PRINT "Cannot predict now."
300   IF R=15 THEN PRINT "Concentrate and ask again."
310   IF R=16 THEN PRINT "Don't count on it."
320   IF R=17 THEN PRINT "My reply is no."
330   IF R=18 THEN PRINT "My sources say no."
340   IF R=19 THEN PRINT "Outlook not so good."
350   IF R=20 THEN PRINT "Very doubtful."
360   PRINT
370   INPUT "Do you want to ask another question (Y/N)? " A$
380 UNTIL A$="N" OR A$="n"
390 CLS
400 PRINT "Goodbye... the Magic 8 Ball rests!"

In the above code, you will noticed that the code within the REPEAT UNTIL loop has been indented (2 spaces at the front of each line of code, between the line number and the code for the line). Though this is not mandatory, it is good practice to indent your code when using loops or IF statements as it makes the code easier to read.

BBC Micro – Organising Files on a Disk

This tutorial is the second of a set of lessons/tutorials that focus on:

BBC Micro Online Emulator

To complete these lessons, you do not need access to a physical BBC micro computer. You can use the following online emulator and type commands in your browser, without the need to install anything on your computer.

You may also find the following BBC Basic emulator quite handy for testing your own BBC Basic programs.

Using Floppy Disk Drives

If you are using a physical computer, remember that the BBC Micro model B does not come with a hard drive to save your work. It is possible to connect a floppy disk drive to save your work on a 5.25″ Double Density floppy disk. Depending on the model of your BBC Micro, you may be able to connect it to a 3.5″ floppy disk drive to use with Double Density (DD) floppy disks with a capacity of around 1MB. This is probably a more reliable solution.

💾 Disk Filing Systems (DFS and ADFS)

The original BBC Micros used a DFS (Disk Filing System) which means they used a flat file structure with a single catalogue of files on the disk. On a DFS system, it is not possible to create a true hierarchical structure using folders/directories.

There is a concept of a directory qualifier — a single letter prefix that groups files (e.g., W.MEMO means file MEMO in directory W which could stand for WORK for instance where G.RACING could be used to store a racing game in directory G for GAMES). This looks like folders but is purely a single-letter categorisation mechanism rather than a true nested directory structure.

With a standard BBC Micro (DFS), you cannot have multiple levels of directories with standard BBC DFS — it’s all in one flat catalogue (with a maximum of 31 files per disk). Also filenames need to be 7 characters or less.

More recent BBC Micros benefited from a more advanced filing system called ADFS (Advanced Disc Filing System) — an upgrade that supports real hierarchical folders/directories, structured in a tree (folders and sub-folders).

This was available on later BBC Micros and upgrades, and later machines like the BBC Master.

💾 Creating, Saving and Loading files on a BBC Micro (DFS)

On the BBC Micro, the main disks operations such as viewing the content of the disk use special commands (starting with *).

📂 Viewing What's on the Disk
For instance to see what files and folders are on the current disk, use the following command:

*CAT

This will show a list of files on the disk.

To simulate opening a directory and hence focus on showing the files from the same group (using the same directory qualifier) use the following command:

*DIR W
*CAT

This would show all the files with the prefix W.

✏️ Typing Your First Program
Using the commend prompt, type the following code (including the line numbers):

10 MODE 2
20 COLOUR RND(7)
30 PRINT "HELLO WORLD"
40 GOTO 20

This program is written in a language called BBC Basic, a language created with the aim of making computer programming accessible to beginners through a simple yet powerful language on the BBC Micro computer.

You can now run this code by pressing the following command:

RUN

⚠️ To stop this program, press the BREAK key on the keyboard.

💾 Saving Files

After typing and testing your program, you will want to save it to the disk. Use the following command to do so:

SAVE "HELLO"

It will be saved on the disk with the filename HELLO.
⚠️Remember, on the BBC Micro file names cannot exceed 7 characters!

To save this file into a specific group (such as your WORK group: W):

SAVE "W.HELLO"

This saves HELLO within the W group. Remember groups are an alternative to the use of folders/directories as these cannot be created within a standard BBC Micro (DFS).

📃 Loading a Program into Memory
To load the program:

LOAD "HELLO"

This copies the program from disk into the computer’s memory.

You can check it loaded by typing:

LIST

You should now see your program lines on the screen.

▶️ Running the Program
To run the program after loading it:

RUN

Your program will now start.

⚡ Quick Way: Load and Run in One Command
You can also load and run a program in one step using:

CHAIN "HELLO"

This is very commonly used for games and larger programs.

✏️ Renaming Files
To rename a file:

*RENAME oldname newname

Example:

*RENAME HELLO TEST

This renames file HELLO to TEST.

⚠️ Be careful — if the new name already exists, it may overwrite it.

🗑 Deleting Files
To delete a file:

*DELETE filename

Example:

*DELETE OLDGAME

⚠️ Deleted files cannot be recovered.

✏️ Editing a Program
If you want to edit an existing progam, you first need to make sure it is already loaded in memory:

LOAD HELLO

Then you can view the code of this program using the following command:

LIST

✏️ To change an existing line of your program

If your program has:

10 PRINT "HELLO"

and you want to change it to say:

10 PRINT "HELLO WORLD"

Just type:

10 PRINT "HELLO WORLD"

and press RETURN.

Line 10 is now replaced.

➕ Adding New Lines

To add a new line between 10 and 20, use a number in between:

15 PRINT "WELCOME!"

BBC BASIC keeps the program in number order automatically.

️➖ Deleting a Line

To delete line 15, type:

15

and press RETURN.

That line is removed from the program.

📃 Listing Part of a Program

To see only part of the program, type the following command:

LIST 10,50

This lists lines 10 to 50 only. This is very useful when working on a long program.

💾 Saving Your Changes

After editing, save again to keep your changes:

SAVE "HELLO"

This overwrites the old version with the new one.

⚠️ If you want to keep both versions, use a new name:

SAVE "HELLO2"

⭐ Extra Tip: Renumbering Lines

If after inserting and removing lines, your line numbers get messy, you can renumber the whole program:

RENUMBER

or even better, using the following command:

RENUMBER 10,10

(start at 10, count by 10)
This makes it easier to insert new lines later.

Your Task

Use all of the above commands to recreate the following file structure on your BBC Micro Computer or using the online emulator.

D.HELLO
D.SPLASH
W.TIMES
W.MOON
W.PASS

In the above file structure D stands for DEMO and W stands for WORK.

Our four files will contain the code provided in the four tabs below:

D.HELLO fileD.SPLASH fileW.TIMES fileW.MOON fileW.PASS file
D.HELLO file:
A colourful “Hello World” program.

10 MODE 2
20 COLOUR RND(7)
30 PRINT "HELLO WORLD"
40 GOTO 20
D.SPLASH file:
This code is a demo of a splash screen using blinking red text.

10 MODE 7
20 PRINT CHR$(136)CHR$(129)"SPLASH SCREEN!"
W.TIMES file:
A program used to generate a times table:

10 REM Times Table Generator
20 INPUT "Enter a number: " ; n
30 PRINT
40 FOR i = 1 TO 10
50   PRINT n; " x "; i; " = "; n*i
60 NEXT
W.MOON file:
A program to caluculate you weight on the Moon!

10 REM Weight on the Moon Calculator
20 INPUT "Enter your weight on Earth in kg: " ; weight
30 moon = weight / 6
40 PRINT
50 PRINT "Your weight on the Moon would be:"
60 PRINT moon; " kg"
W.PASS file:
A program used to generate a random password:

10 REM PASSWORD GENERATOR
20 password$ = ""
30 FOR i = 1 TO 8
40 r = RND(36) - 1
50 IF r < 26 password$ = password$ + CHR$(65 + r) ELSE password$ = password$ + CHR$(48 + r - 26)
60 NEXT
70 PRINT "Password: "; password$

Getting Started with the BBC Micro (Model B)

The BBC Microcomputer Model B (often called the Beeb) was a popular computer in UK schools in the 1980s. It was made in the UK by Acorn Computers Ltd. During its lifespan there were over 1.5 million units manufactured from 1981 to 1994. It was designed to help people learn programming and understand how computers work.

This tutorial is the first of a set of lessons/tutorials that focus on:

BBC Micro Online Emulator

To complete these lessons, you do not need access to a physical BBC micro computer. You can use the following online emulator and type commands in your browser, without the need to install anything on your computer.

You may also find the following BBC Basic emulator quite handy for testing your own BBC Basic programs.

Getting Started with a BBC Micro (or using an online emulator!)

This first “Getting Started” tutorial will help you turn your BBC Micro on, type commands, and run your first program.

1. Connecting the BBC Micro

If you are using the online emulator, you can bypass this section.
Otherwise, if you are working with a real BBC Micro computer, you will need:

  • ✅ BBC Micro Model B computer
  • ✅ Power cable
  • ✅ Display (TV or monitor with suitable SCART cable or SCART to HDMI converter)

The BBC Micro has a built-in keyboard. There is no mouse but some advanced gamers would use a joystick to play video games.

BBC Micro Computer Model B

The BBC Micro model B does not come with a hard drive to save your work. It is possible to connect a floppy disk drive to save your work on a 5.25″ floppy disk. Depending on the model of your BBC Micro, you may be able to connect it to a 3.5″ floppy disk drive to use with Double Density (DD) floppy disks with a capacity of around 1MB. This is probably a more reliable solution.

To start your BBC Micro, you should:

  1. Turn on the monitor first.
  2. Switch on the BBC Micro using the switch at the back.

After a few seconds you should see:

BBC Computer
Acorn DFS

>

The > symbol is the command prompt. This means the computer is ready for instructions.

About the keyboard:
The keyboard is simlar in may ways with a modern QWERTY keyboard, You will find the following four keys particularly useful:

  • RETURN key → same as Enter
  • DELETE key → same as a backspace key
  • BREAK key → stops a program and resets the computer.
    ⚠️ Pressing BREAK will clear anything currently running.
  • SHIFT key → for capital letters and symbols
⌨️ 2. Typing Your First Command

Let’s try a simple command.

At the > prompt, type:
PRINT "HELLO WORLD"

Then press RETURN.

You should see:
HELLO WORLD
Well done — you’ve just told the computer to display text!

3. Writing Your First Program

Now let’s write a small program in BBC BASIC.

Type the following exactly (including the line numbers):

10 PRINT "HELLO BBC MICRO!"
20 GOTO 10

Press RETURN after each line.

Now type:

RUN

and press RETURN.

The message will repeat over and over on the screen.

⚠️ To stop it, press the BREAK key on the keyboard.

Let’s improve the output of this Hello World program by adding some colours:

10 MODE 2
20 COLOUR RND(7)
30 PRINT "HELLO WORLD"
40 GOTO 20

Here is what your code will produce when you run it:


You can now continue through our set of 4 lessons on how to use the BBC Micro to code basic Programs in BBC Basic. (See links at the top of this page).

You may also find the original BBC Micro User Guide very useful to learn everything there is to know about the BBC Micro!

Computer Hardware: CPU and Memory – Crossword

crosswordHow well do you really know the inner workings of a computer? From the lightning-fast calculations of the CPU to the different types of memory that store data, computer hardware is full of essential components that quietly power everything we do.

In this crossword, we are focusing on three core areas of computer hardware:

The CPU (Central Processing Unit) – A complex microchip responsible for executing instructions, performing calculations, and coordinating the activities of all other components.

Primary memory – the fast, short-term memory a computer uses to store data and instructions that are actively in use. This includes components like RAM, which allow programs to run smoothly and efficiently.

Secondary memory – the long-term storage that keeps data (files, applications, and operating systems) even when the computer is turned off. Magnetic hard drives, SSDs and other storage devices fall into this category.

Computer Hardware CrosswordOpen Crossword Puzzle in a New Window
Computer Hardware CrosswordOpen Crossword Puzzle in a New Window
unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Computer Science Legislation (UK) – Take the Quiz

When people use computers, phones and the internet, they create and share huge amounts of data and digital content. To protect people and organisations, the UK has several important laws that control how technology can be used.

In this activity, you will be sorting real-world inspired case files into the correct legal category. Before you start, here is a quick reminder of the three main UK laws you need to know for Computer Science and Digital Technology courses.

In the UK, there are three main acts that are very relevant to the use of computer science technologies:

  1. The Copyright, Designs & Patents Act
  2. The Data Protection Act
  3. The Computer Misuse Act

Let’s find out more about this legislation.

The Data Protection ActThe Computer Misuse ActThe Copyright, Designs & Patents Act

The Data Protection Act

The Data Protection Act works alongside GDPR (General Data Protection Regulation) to protect people’s personal data.

The purpose of this act is to ensure our personal data is being used and dealt with sensibly.

Example of personal data:

  • Name and address
  • Date of birth
  • Employment records
  • Medical records
  • Religion/faith

This act stipulates that personal information stored on a computer system must be kept securely.

Personal data shall be processed fairly and lawfully in accordance with the rights of data subjects.

When an organisation stores personal data about individuals on a computer system, they must only store data that is relevant/necessary, accurate and up-to-date.

Personal data kept by an organisation on a computer system shall not be kept for longer than is necessary and should be deleted if it is no longer needed.

When personal data is shared with a third party, it has to be done fairly and lawfully, securely and with the permission of the data subject.

The Computer Misuse Act

The purpose of this act is to discourage people from accessing computer systems without permission (hacking) whether to intend to commit further illegal activities or not.

This acts make it illegal to access data on a computer when that material will be used to commit further illegal activity, such as fraud or blackmail.

It is also illegal to access and change the contents of someone’s files without their permission. It is therefore illegal to install a virus or other malware on someone’s computer as this is done without their consent.

This act also makes it illegal to carry out attacks that stop systems from working (e.g. DDoS attacks)

The Copyright, Designs & Patents Act

This act provides a legal means of ensuring that content creators can protect the work they have produced.

When anyone creates something, they automatically own it. This could include:

  • a picture, drawing or photograph
  • an animation, a film or a video clip
  • a sound file, podcast or music
  • a piece of text incl. an article, news report, blog post or a book
  • a video game or a computer program (e.g. source code)

When using copyrighted material, it is illegal to…

  • Make copies
  • Publish
  • Distribute
  • Sell copies

…unless you have been given permission by the copyright owner.

UK Legislation Quiz

You will now be shown a series of case files based on real events involving:

  • Data leaks
  • Hacking attacks
  • Illegal sharing of digital content

Your task is to:

  1. Read each case carefully
  2. Decide which law it is most closely related to
  3. Drag the case into the correct legal folder

You can change your mind and move cases again before finishing!

Can you correctly sort all the cases and get a perfect score? Good luck, and think carefully about which law applies in each situation!
UK Legislation – Drag and DropOpen in New Window

Mission Artemis (Python Challenge)

The Artemis program is a Moon exploration program led by the NASA. Its aim is to re-establish a human presence on the Moon for the first time since the Apollo 17 mission in 1972. It will consists of different missions with a long-term goal of establishing a permanent base on the Moon. The intention is also to facilitate further human missions to Mars.

In this challenge, we will focus on two of the main missions of this program:

  • Mission Artemis II which will send 4 astronauts on board the Orion spacecraft to orbit around the Moon and return back to planet Earth
  • Mission Artemis III which will send 4 astronauts on board the Orion spacecraft to approach the Moon, place a lunar Gateway Station, and then use this gateway to send 2 astronauts to descend to the lunar surface and and spend about 6.5 days on the surface.

Our aim is to write a Python program to help the engineers at NASA plan these two missions and check whether the planned missions are safe to launch.

Effectively, before launch, the NASA engineers must check if the spacecraft used for the mission is carrying enough oxygen and food for the crew.

Mission Data

We will use the following values in your program:

Crew and Duration
Mission Crew Days
Artemis II 4 10
Artemis III 4 30
Supplies Needed Per Astronaut Per Day
  • Oxygen per day = 5 units
  • Food per day = 3 units
Spacecraft Capacity
  • Maximum oxygen = 800 units
  • Maximum food = 500 units

Task 1 – Store the Data in Variables

Create variables for:

    crew size
    number of days
    oxygen per day
    food per day
    maximum oxygen
    maximum food
Show me how...
crew = 4
days = 10
oxygen_per_day = 5
food_per_day = 3
max_oxygen = 800
max_food = 500

Python Code:

Task 2 – Ask the User to Choose a Mission

Ask the user to enter a mission number:

  • 2 for mission Artemis II
  • 3 for mission Artemis III

Make sure that the user can only select one of these two options.

Show me how...
mission = input("Select a mission: Enter 2 for Mission Artemis II or 3 for mission Artemis III")

while mission!="2" and mission!="3":
   print("Invalid mission code. Please try again.")
   mission = input("Select a mission: Enter 2 for Mission Artemis II or 3 for mission Artemis III")

Then use an if statement to reset the correct number of days and crew size.

Show me how...
if mission=="2":
   mission_name = "Artemis II"
   spaceship = "Orion"
   crew = 4
   days = 10
elif mission=="3":
   mission_name = "Artemis III"
   spaceship = "Orion"
   crew = 4
   days = 30   

Task 3 – Calculate Supplies Needed

Use the following formulas to estimate the quantity of oxygen and of food that will be required to complete the mission:

    Total oxygen = crew × days × oxygen per day
    Total food = crew × days × food per day
Show me how...
total_oxygen = crew * days * oxygen_per_day
total_food = crew * days * food_per_day

Display the results to the user.

Show me how...
print("Total oxygen needed for this mission: " + str(total_oxygen) + " units")
print("Total food needed for this mission: " + str(total_food) + " units")

Task 4 – Check If the Mission Is Safe

If both oxygen and food are within spacecraft limits, display:

+--------------------------+
|     READY FOR LAUNCH!    |
+--------------------------+

Otherwise, display:

+--------------------------+
|   NOT SAFE TO LAUNCH!    |
+--------------------------+
Show me how...
if total_oxygen<=max_oxygen and total_food<=max_food:
   status = "Ready for launch!"
   print("""
+--------------------------+
|     READY FOR LAUNCH!    |
+--------------------------+
""")
else:
   status = "Not safe to launch!"
   print("""
+--------------------------+
|   NOT SAFE TO LAUNCH!    |
+--------------------------+
""")

Task 5 – Display a Mission Report

Display a mission report showing the following information:

  • Mission name
  • Spaceship
  • Crew size
  • Duration
  • Oxygen needed
  • Food needed
  • Launch status

Exemplar output:

Mission: Artemis II
Spaceship: Orion
Crew: 4
Days: 10
Oxygen needed: 200 units
Food needed: 120 units
Status: READY FOR LAUNCH
Show me how...
print("--- MISSION REPORT ---")
print("Mission: " + mission_name)
print("Spaceship: " + spaceship)
print("Crew: " + str(crew))
print("Days: " + str(days))
print("Oxygen needed: " + str(total_oxygen) + " units")
print("Food needed: " + str(total_food) + " units")
print("Mission Status: " + status)

Extension Task 1 – Safety Buffer

For a mission to be considered safe and ready to launch, the engineers at NASA want to allow 15% extra supplies to both oxygen and food before checking safety.

Your task is to change the code to add this extra buffer to booth the required oxygen and food.

Show me how...
total_oxygen = round(total_oxygen * 1.15,2)
total_food = round(total_food * 1.15,2)

Extension Task 2 – Extra Spaceships and Extra Missions

Add an option at the start of your program to let the user pick a different spaceship to complete a mission.
You could have a collection of spaceships to opt for, each spaceship having its own oxygen and food capacity, e.g.

Spaceship Oxygen Capacity Food Capacity
Orion 800 units 500 units
Space Voyager 1200 units 800 units
Deep Space Explorer 2400 units 1800 units

Create additional missions for Artemis Mission III, Artemis Mission IV and Artemis Mission V, each mission having its own crew size, duration (in days) and spaceship. Remember the final aim of the Artemis program is to set foot on planet Mars!

Mission Crew Days
Artemis II (Moon orbit) 4 10
Artemis III (Moon landing) 4 30
Artemis IV (Lunar station) 6 45
Artemis V (Extended lunar mission) 8 60


unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

The Environmental Impacts of Computer Science Quiz

Computer science is a driving force behind modern life, shaping how we communicate, work, and entertain ourselves. However, the rapid growth of technology also has significant environmental consequences. This article explores the environmental challenges posed by technology, the positive changes it can bring, and practical solutions to minimise harm.

The Negative Environmental Impacts of Technology

1. The Hidden Cost of Mining Minerals
The production of smartphones, laptops, and batteries relies on rare minerals like lithium, cobalt, gold, and copper. Mining these resources often leads to deforestation, water pollution, and habitat destruction. For example, cobalt mining in the Democratic Republic of Congo has been linked to human rights abuses, including child labour. The extraction process is also energy-intensive, further contributing to environmental degradation.

2. The Carbon Footprint of Digital Activities
Every time you stream a video, send an email, or play an online game, you’re contributing to the energy consumption of data centres. These facilities, which power the internet, can use as much electricity as entire cities. Much of this energy still comes from fossil fuels, releasing carbon dioxide (CO₂) and accelerating climate change. While companies like Google and Microsoft are shifting to renewable energy, the demand for digital services continues to grow, making energy efficiency a critical issue.

3. The Challenge of E-Waste
Electronic waste, or e-waste, is one of the fastest-growing waste streams in the world. When old devices are discarded, toxic materials like lead, mercury, and cadmium can leak into the soil and water, posing serious health risks. Despite the potential to recycle valuable components, only a small fraction of e-waste is properly processed. This highlights the urgent need for better recycling programs and more sustainable product design.

The Positive Environmental Impacts of Technology

1. Reducing the Need to Commute
Technology has revolutionised how we work and communicate. Teleworking and video conferencing reduce the need for travel, cutting down on emissions from cars and planes. The rise of remote work, accelerated by the COVID-19 pandemic, has shown that many jobs can be done effectively from home, leading to fewer commutes and less air pollution.

2. Raising Environmental Awareness
Social media platforms like Instagram, Twitter, and TikTok have become powerful tools for spreading awareness about environmental issues. Campaigns such as #ClimateAction and #ZeroWaste have inspired millions to adopt sustainable habits. Activists and organisations use these platforms to share information, organise events, and mobilise communities, making it easier than ever to advocate for change.

3. Smart Systems and Energy Efficiency
Computer science is also driving innovations that help protect the environment. Smart systems in homes and cities can reduce energy waste by automatically adjusting lighting, heating, and cooling based on usage. Artificial intelligence (AI) is being used to monitor deforestation, track endangered species, and optimise energy use in industries. By designing efficient algorithms and promoting green tech, computer scientists are helping to create a more sustainable future.

Approaches to Minimise Negative Impacts

1. Standardisation: Reducing E-Waste
One of the simplest ways to cut down on e-waste is through standardisation. For example, the European Union’s decision to mandate USB-C chargers for all smartphones, tablets, and cameras means consumers no longer need to replace chargers with every new device. This small change can significantly reduce unnecessary waste and make technology more sustainable.

2. Designing for Recyclability
Many electronic devices are difficult to recycle because they are made with mixed materials that are hard to separate. Companies can address this by designing hardware with recyclability in mind. For instance:

  • Using modular designs allows users to replace individual parts instead of discarding entire devices.
  • Avoiding glue and using screws or snap-fit components makes devices easier to disassemble.
  • Clearly labelling parts with their material composition helps recyclers sort and process them more efficiently.

3. Relocating Data Centres to Cooler Climates
Data centres consume vast amounts of energy, not just to power servers but also to keep them cool. Relocating these facilities to colder regions, such as Iceland or Norway, allows them to use natural cooling, reducing the need for energy-intensive air conditioning. Some companies, like Facebook and Google, have already built data centres in these locations, often powered by renewable energy sources like hydroelectricity.

4. Promoting Renewable Energy
Transitioning to renewable energy—such as wind, solar, and hydroelectric power—is one of the most effective ways to reduce the carbon footprint of technology. Many tech companies, including Apple and Microsoft, have pledged to use 100% renewable energy for their operations. Governments can support this shift by offering incentives for companies that invest in green energy.

5. Encouraging a Circular Economy
A circular economy focuses on reusing, repairing, and recycling products to extend their lifespan. For technology, this means:

  • Refurbishing and reselling old devices instead of discarding them.
  • Offering trade-in programs where companies take back old devices for recycling or refurbishment.
  • Supporting right-to-repair laws, which require manufacturers to provide the tools and information needed for consumers to fix their own devices.

6. Using Cloud Computing Efficiently
Cloud computing can be more energy-efficient than traditional IT setups if managed properly. Companies can reduce their environmental impact by:

  • Consolidating servers to run at higher capacity.
  • Using virtualisation to run multiple applications on a single server.
  • Optimising code and algorithms to run more efficiently.

7. Raising Consumer Awareness
Many people are unaware of the environmental impact of their tech habits. Educating consumers about sustainable choices—such as buying refurbished devices, recycling old electronics, and using energy-saving settings—can make a big difference. Campaigns and labels that highlight the environmental credentials of products (like Energy Star ratings) can help people make more informed decisions.

8. Supporting Green Tech Innovations
Innovation is key to reducing the environmental impact of technology. Some exciting developments include:

  • Biodegradable electronics: Researchers are experimenting with materials that break down naturally, reducing e-waste.
  • Low-power processors: New chips are being designed to use less energy without sacrificing performance.
  • AI for energy efficiency: Artificial intelligence can optimise energy use in data centres and smart buildings, cutting down on waste.

Conclusion

Computer science has a profound impact on the environment, but it also offers powerful tools to address these challenges. By understanding both the positive and negative effects of technology, we can make informed choices that promote sustainability. Whether through standardisation, renewable energy, or innovative design, there are many ways to reduce the environmental footprint of technology. As future computer scientists, engineers, and consumers, you have the opportunity to drive change and help create a greener, more sustainable world.

Computer Science UK Legislation Quiz (GCSE Level)

In today’s digital age, technology touches almost every aspect of life – from how we communicate and create to how we protect our personal information. But with these advancements come important legal responsibilities. The UK has established key laws to ensure that technology is used ethically, safely, and fairly. For anyone interested in computer science, understanding these laws is essential, as they govern everything from data privacy and cybersecurity to the protection of creative work.

Three major acts form the foundation of UK legislation relevant to computer science: the Data Protection Act 2018, the Computer Misuse Act 1990, and the Copyright, Designs and Patents Act 1988. These laws help protect individuals’ rights, prevent misuse of technology, and ensure that creators are recognised for their work. Whether you are coding, sharing content online, or simply using digital services, these acts play a crucial role in shaping how technology is used—and misused—in society. Let’s explore what each of these laws covers and why they matter.

The Data Protection Act 2018

The Data Protection Act 2018 is the UK’s version of the General Data Protection Regulation (GDPR), setting out how personal data must be handled. Personal data includes any information that can identify a living person, such as names, email addresses, or even online identifiers like IP addresses. The Act ensures that data is collected, stored, and used in a lawful, fair, and transparent way.

Individuals have specific rights under this law, including the right to access their data, correct inaccuracies, and request deletion (known as the “right to be forgotten”). Organisations must protect data from unauthorised access or breaches and can only use data for its intended purpose. For instance, if a website collects email addresses for newsletters, it cannot use those addresses for unrelated marketing without explicit consent.

This Act highlights the importance of privacy and security, especially as more aspects of life move online. It ensures that personal information is treated with care and respect.

The Computer Misuse Act 1990

The Computer Misuse Act 1990 is designed to combat cybercrime by making it illegal to access computer systems or data without permission. It also prohibits unauthorised modification of data or actions that impair the operation of computers. The Act covers three main offences: unauthorised access to computer material, accessing data with intent to commit further crimes, and actions that damage or disrupt computer systems.

Examples of offences under this law include hacking into accounts, spreading viruses, or launching attacks to crash websites. Even sharing login details without permission can be considered a violation. The Act serves as a reminder that ethical behaviour is not just a moral choice but a legal requirement in the digital world.

In an era where cyber threats are increasingly common, this law plays a critical role in protecting individuals and organisations from malicious activities.

The Copyright, Designs and Patents Act 1988

The Copyright, Designs and Patents Act 1988 protects the rights of creators over their original works, including software, music, literature, and art. Copyright gives creators exclusive rights to use, distribute, and modify their work, preventing others from doing so without permission.

This means that downloading or sharing copyrighted material—such as music, films, or software—without authorisation is illegal. It also applies to using online content in projects unless the work is licensed for reuse or falls under “fair dealing” for educational purposes. Fair dealing allows limited use of copyrighted material for criticism, review, or education, but it does not permit copying or distributing entire works.

Understanding copyright law is essential for anyone creating or using digital content. It ensures that creators receive recognition and compensation for their work while encouraging respect for intellectual property.

Why These Laws Matter

The Data Protection Act 2018, the Computer Misuse Act 1990, and the Copyright, Designs and Patents Act 1988 form the legal backbone of ethical and responsible technology use. They protect personal privacy, prevent cybercrime, and safeguard creative works. As technology continues to advance, these laws help ensure that digital interactions remain safe, fair, and respectful for everyone.

Network Security Quiz (GCSE Level)

Network security — often called cybersecurity — refers to the practices, technologies, and processes designed to protect computers, networks, and data from unauthorised access, attacks, damage, or theft. It encompasses everything from safeguarding personal devices and home Wi-Fi to securing large corporate systems and government infrastructure. In essence, it’s about keeping digital information safe, private, and available only to those who should have access. Whether it’s defending against hackers, preventing viruses, or ensuring safe online communication, cybersecurity is the shield that keeps our digital world secure.

Forms of Attack: Recognising the Threats

Networks and systems face a variety of threats, each designed to exploit vulnerabilities in different ways.

Malware — short for malicious software — is one of the most common threats. It includes viruses, worms, Trojans, and ransomware, which can damage systems, steal data, or hold files hostage until a ransom is paid. Malware often spreads through infected downloads, email attachments, or compromised websites.

Social engineering and phishing attacks rely on human psychology rather than technical flaws. Attackers trick individuals into revealing sensitive information, such as passwords or credit card details, by posing as trustworthy entities. Phishing emails, for example, might mimic messages from banks or popular services, urging users to click on malicious links or download harmful attachments.

Brute-force attacks involve systematically trying every possible password combination until the correct one is found. These attacks exploit weak or commonly used passwords and can be mitigated by enforcing strong password policies.

Denial of Service (DoS) attacks aim to overwhelm a network or website with traffic, rendering it inaccessible to legitimate users. Distributed Denial of Service (DDoS) attacks use multiple compromised devices (often part of a botnet) to amplify the assault, making them harder to defend against.

Data interception and theft occur when attackers eavesdrop on unsecured networks to capture sensitive information, such as login credentials or financial data. This is particularly risky on public Wi-Fi networks, where data is often transmitted without encryption.

Finally, SQL injection is a technique where attackers insert malicious SQL code into a database query, allowing them to manipulate or extract data. Websites with poorly secured input fields are especially vulnerable to this type of attack.

Modes of Connection: Wired and Wireless Networks

Understanding how devices connect to networks is fundamental to grasping network security. Wired connections, such as Ethernet, use physical cables to transmit data. Ethernet is known for its reliability, speed, and security, as it is less susceptible to interference and unauthorised access compared to wireless methods.

On the other hand, wireless connections offer convenience and mobility. Wi-Fi allows devices to connect to a network without cables, making it ideal for homes, schools, and public spaces. However, Wi-Fi networks can be vulnerable to eavesdropping if not properly secured. Bluetooth is another wireless technology, typically used for short-range connections between devices like smartphones, headphones, and speakers. While convenient, Bluetooth connections can also be exploited if left unsecured or paired with unknown devices.

Common Prevention Methods: Safeguarding Networks

Preventing cyber threats requires a combination of technical solutions and best practices.

Penetration testing involves simulating attacks on a network to identify and address vulnerabilities before malicious actors can exploit them. This proactive approach helps organisations strengthen their defences.

Anti-malware software is essential for detecting, quarantining, and removing malicious programs. Regular updates ensure that the software can recognise and defend against the latest threats.

Firewalls act as a barrier between a trusted internal network and untrusted external networks, such as the internet. They monitor and control incoming and outgoing traffic based on predefined security rules, blocking potential threats.

User access levels ensure that individuals only have access to the data and systems necessary for their roles. This principle of least privilege minimises the risk of unauthorised access or accidental data exposure.

Passwords remain a first line of defence, but their effectiveness depends on their complexity and management. Strong passwords should be long, unique, and include a mix of characters. Multi-factor authentication (MFA) adds an extra layer of security by requiring additional verification steps, such as a code sent to a mobile device.

Encryption protects data by converting it into a coded format that can only be deciphered with the correct key. This is crucial for securing data both in transit (e.g., over the internet) and at rest (e.g., stored on a device).

Finally, physical security measures, such as locked server rooms or secure disposal of hardware, prevent unauthorised individuals from gaining physical access to sensitive systems or data.

Conclusion: Building a Secure Digital Future

Network security is a dynamic and essential field in computer science. By understanding the various forms of attack, the differences between wired and wireless connections, and the common prevention methods, individuals and organisations can gain an awareness of how to keep their network, online communication and digital data safe. As technology continues to evolve, so too will the threats and defences — making this knowledge more valuable than ever.